package Feb_10.Task;

import java.io.*;

public class Task3 {
    public static void main(String[] args) throws IOException {
        File file = new File("E:/log.txt");
        if (!file.exists()){
            file.createNewFile();
        }
        try (FileWriter fileWriter = new FileWriter(file);
             BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
             BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in))){
            String str = bufferedReader.readLine();
            while (!(str.equals("exit"))){
                bufferedWriter.write(str);
                bufferedWriter.newLine();
                str=bufferedReader.readLine();
            }
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
